package com.meta.nd.filter.vo;


import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class FilterByDefVo implements Cloneable {
    String filterDefCode;
    List<FilterFd> filterFds = new ArrayList<>();
    List<ResultFd> resultFds = new ArrayList<>();
    int startNo;
    int count;
    public FilterByDefVo clone(){
        try {
            FilterByDefVo result =(FilterByDefVo) super.clone();
            result.filterFds = new ArrayList<>();
            filterFds.addAll(this.filterFds);
            return result;
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return null;
    }

    public void addFilterFd(FilterFd filterFd){
        this.filterFds.add(filterFd);
    }

    public boolean containFilterFd(String aliasName){
        for( FilterFd filterFd : this.filterFds){
            if ( filterFd.getFinalName().equals(aliasName))
                return true;
        }
        return false;
    }

}
